<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="UTF-8">
  <title>DBtoDoc-导出PDF</title>
  <link rel="stylesheet" href="/layui/css/layui.css">
  <script src="/layui/layui.js"></script>
  <style>
    /*设置页面默认横板，实测谷歌和360浏览器兼容，ie，edge不好使*/
    @page {
      size: landscape;
    }
  </style>
</head>
<body>
<div id="content" class="layui-row" style="width: 95vw;margin: 15px auto;">
  <h1 style="text-align: center;" id="dbName">test</h1>
  <div class="layui-row" style="margin-top: 30px;">
    <table class="layui-table">
      <colgroup>
        <col width="150">
        <col width="80">
        <col width="100">
        <col width="120">
        <col width="150">
        <col width="130">
        <col width="180">
        <col width="100">
        <col>
      </colgroup>
      <thead>
      <tr>
        <th>表名</th>
        <th>引擎</th>
        <th>总行</th>
        <th>总大小/byte</th>
        <th>创建时间</th>
        <th>排序规则</th>
        <th>注释</th>
      </tr>
      </thead>
      <tbody th:each="item:${data}">
      <tr>
        <td th:text="${item.tableName}">表名</td>
        <td th:text="${item.engine}">表名</td>
        <td th:text="${item.rows}">表名</td>
        <td th:text="${item.size}">表名</td>
        <td th:text="${item.createTime}">表名</td>
        <td th:text="${item.tableCollation}">表名</td>
        <td th:text="${item.tableComment}">表名</td>
      </tr>
      </tbody>
    </table>
  </div>
</div>

<script>
  var $;
  layui.use(['jquery'], function () {
    $ = layui.jquery;
    $(function () {
      window.setTimeout(function () {
        window.print()//打印
      }, 1000)
    })
  })
</script>
</body>
</html>
